class UserModel {
  final int id;
  final String account;
  final String password;
  final String nickname;
  final String avatar;
  final String description;

  UserModel({
    required this.id,
    required this.account,
    required this.password,
    required this.nickname,
    required this.avatar,
    this.description = "",
  });

  factory UserModel.fromJson(Map<String, dynamic> json) => UserModel(
    id: json['id'],
    account: json['account'],
    password: json['password'],
    nickname: json['nickname'],
    avatar: json['avatar'],
    description: json['description'] ?? "",
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'account': account,
    'password': password,
    'nickname': nickname,
    'avatar': avatar,
    'description': description,
  };
}
